/**
 * 
 */
package org.wicket.jbpm.engine.spring;

import java.util.List;

import org.jbpm.graph.exe.Comment;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.taskmgmt.def.Task;
import org.wicket.jbpm.engine.exception.WicketJbpmException;
import org.wicket.jbpm.engine.workflow.WfTask;

/**
 * @author Emmanuel Nollase - emanux
 * created: Jun 1, 2009 - 6:43:10 PM
 */
public interface JbpmLogEngine {
	
	/**
	 * @return - list of completed task
	 */
	List<WfTask> findAllCompletedTask();
	
	/**
	 * Finds all OPEN ProcessInstance
	 * @return - list of Open ProcessIntance
	 */
	List<ProcessInstance> findAllOpenProcessInstance();
	
	/**
	 * Finds all CLOSE ProcessInstance
	 * @return - list of Open ProcessIntance
	 */
	List<ProcessInstance> findAllCloseProcessInstance();
	
	/**
	 * Finds all TaskInstance related to ProcessInstance
	 * @return - list of WfTask (TaskInstance)
	 */
	List<WfTask> findAllTaskByProcessInstance(final ProcessInstance instance) throws WicketJbpmException;
	
	/**
	 *  Finds all TaskInstance completed by specific actor
	 * @param actorid - task by specific user/s
	 * @return - list of WfTask (TaskInstance)
	 */
	List<WfTask> findAllCompletedTaskByActor(final String actorid) throws WicketJbpmException;
	
	/**
	 * Finds all comments in a TaskInstance
	 * @param taskId - taskInstanceId
	 * @return
	 */
	List<Comment> findAllComments(final Long taskId) throws WicketJbpmException;
	
	/**
	 * Find the remaining task for process instance
	 * @param process - 
	 * @return
	 */
	List<Task> findNextTasksByProcessInstance(final ProcessInstance process) throws WicketJbpmException;
}
